package com.grandtech.insurance.common.core.coding;

import com.vividsolutions.jts.geom.Envelope;
import com.vividsolutions.jts.geom.Geometry;

import java.util.Map;

public final class Feature implements Cloneable {
    private final String layerName;
    private final int extent;
    private final Geometry geometry;
    private final Map<String, Object> attributes;

    public Feature(String layerName, Geometry geometry, Map<String, Object> attributes) {
        this.layerName = layerName;
        this.extent = 0;
        this.geometry = geometry;
        this.attributes = attributes;
    }

    public Feature(String layerName, int extent, Geometry geometry, Map<String, Object> attributes) {
        this.layerName = layerName;
        this.extent = extent;
        this.geometry = geometry;
        this.attributes = attributes;
    }

    public String getLayerName() {
        return this.layerName;
    }

    public int getExtent() {
        return this.extent;
    }

    public Geometry getGeometry() {
        return this.geometry;
    }

    public Map<String, Object> getAttributes() {
        return this.attributes;
    }

    public Envelope getEnvelope() {
        return geometry.getEnvelopeInternal();
    }
}
